/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.restaurant.hellpers;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author Kamil
 */
@ManagedBean
@SessionScoped
public class UserRights implements Serializable{
    /**
     * Creates a new instance of UserRights
     */
    public UserRights() {
    }
    
    public boolean isAdmin(){
        return FacesContext.getCurrentInstance().getExternalContext().isUserInRole("admin");
    }
    
    public boolean isClient(){
        return FacesContext.getCurrentInstance().getExternalContext().isUserInRole("client");
    }
}
